Opportunistic partial deduplication

ABSTRACT

A technique for managing deduplication performs partial-block matching opportunistically by leveraging information acquired during times when a storage system has available resources. The information identifies anchor blocks that are likely targets for partial-block matches, based on discovering that the anchor blocks belong to populations of blocks that have high similarity. When processing write requests, inline activities access anchor blocks that closely match newly arriving candidate blocks and perform partial-block deduplication against those anchor blocks.

BACKGROUND

Data storage systems are arrangements of hardware and software in which storage processors are coupled to arrays of non-volatile storage devices, such as magnetic disk drives, electronic flash drives, and/or optical drives. The storage processors service storage requests, arriving from host machines (“hosts”), which specify blocks, files, and/or other data elements to be written, read, created, deleted, and so forth. Software running on the storage processors manages incoming storage requests and performs various data processing tasks to organize and secure the data elements on the non-volatile storage devices.

Some storage systems use a process called “deduplication” to improve storage efficiency. For example, a storage system maintains a database of entries, in which each entry stores a digest of a respective block of data and a pointer to a stored version of that block in the storage system. The storage system computes each digest as a hash of a respective block, such that different blocks produce different hash values (digests) and identical blocks produce the same hash values. The high uniqueness of hash values enables the storage system to use them as representatives of respective blocks, even though the hash values themselves are typically much smaller than the blocks they represent. When a storage system receives a write request that specifies a candidate block to be stored at a designated logical address, the storage system computes a hash of the candidate block and performs a lookup into the database for the computed hash. If a match is found, the storage system may confirm the match by comparing the newly-arriving block with the block pointed to by the matching digest entry. Assuming the blocks match, the storage system effectuates storage of the newly-arriving block by pointing its logical address to the previously-stored block pointed to by the matching entry. Redundant storage of the block is therefore avoided. Deduplication may run in-line with storage requests or in the background.

SUMMARY

Inline deduplication poses particular challenges. As is known, inline deduplication involves matching newly arriving data blocks with copies of those blocks that are already stored, enabling a system to avoid initial writes of redundant data to persistent storage. Inline deduplication takes place in real time, or near real time, such as every time the system flushes newly arriving data accumulated in a write cache to persistent storage.

Unlike background deduplication, which can run during off-peak hours when system resources are plentiful, inline deduplication is more constrained. Any resources allocated to inline deduplication run the risk of displacing resources needed for servicing I/O requests, potentially causing a system to violate its service level agreement. To avoid this outcome, system designers typically limit inline deduplication to tight budgets in terms of time delays, memory requirements, and processing cycles.

Resource requirements are even greater when a system supports partial-block deduplication, i.e., cases in which block matching is not exact and additional data has to be stored to account for differences. Typically, partial-block deduplication requires more metadata, more memory, and more processing cycles than does full-block deduplication. For these reasons, partial-block deduplication is usually not an option for inline processing.

In contrast with prior approaches, an improved technique for managing deduplication performs partial-block matching opportunistically by leveraging information acquired during times when a storage system has available resources. The information identifies anchor blocks that are likely targets for partial-block matches, based on discovering that the anchor blocks belong to populations of blocks that have high similarity. When processing write requests, inline activities access anchor blocks that closely match newly arriving candidate blocks and perform partial-block deduplication against those anchor blocks. Partial-block deduplication is thus performed inline without unduly taxing system resources.

Certain embodiments are directed to a method of performing data deduplication. The method includes identifying multiple target blocks that belong to respective populations of data blocks, each population including data blocks that partially match one another. Upon obtaining a candidate block, the method further includes selecting one of the target blocks based on that target block partially matching the candidate block and effectuating storage of the candidate block at least in part by providing a reference to the selected target block.

Other embodiments are directed to a computerized apparatus constructed and arranged to perform a method of performing data deduplication, such as the method described above. Still other embodiments are directed to a computer program product. The computer program product stores instructions which, when executed on control circuitry of a computerized apparatus, cause the computerized apparatus to perform a method of performing data deduplication, such as the method described above.

The foregoing summary is presented for illustrative purposes to assist the reader in readily grasping example features presented herein; however, this summary is not intended to set forth required elements or to limit embodiments hereof in any way. One should appreciate that the above-described features can be combined in any manner that makes technological sense, and that all such combinations are intended to be disclosed herein, regardless of whether such combinations are identified explicitly or not.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The foregoing and other features and advantages will be apparent from the following description of particular embodiments, as illustrated in the accompanying drawings, in which like reference characters refer to the same or similar parts throughout the different views. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of various embodiments.

FIG. 1 is a block diagram of an example environment in which embodiments of the improved technique can be practiced.

FIGS. 2A and 2B are flowcharts that show an example method of deduplicating a candidate block in the environment of FIG. 1.

FIG. 3 is a block diagram that shows an example arrangement for generating a similarity hash (sim hash) of a candidate block.

FIG. 4 is a block diagram that shows an example arrangement for mapping a deduplicated candidate block resulting from a partial match.

FIGS. 5A-5C provide: a diagram that shows an example arrangement for clustering blocks based on sim hashes (FIG. 5A); a flowchart that shows an example method for clustering blocks based on sim hashes (FIG. 5B); and a flowchart that shows an example method of deduplicating blocks in a cluster.

FIG. 6 is a flowchart showing an example method of performing deduplication.

FIG. 7 is a block diagram that shows further details of the environment of FIG. 1.

FIG. 8 is a flowchart showing an example method for performing inline deduplication based on partial-block matches.

FIG. 9 is a flowchart showing an example method for opportunistically performing partial-block deduplication.

DETAILED DESCRIPTION

Embodiments of the improved technique will now be described. One should appreciate that such embodiments are provided by way of example to illustrate certain features and principles but are not intended to be limiting.

This description is provided in the following sections:

-   -   Section I: Deduplicating Full and Partial Block Matches; and     -   Section II: Opportunistic Partial Deduplication.

The embodiments disclosed in Sections I and II may be performed together or independently. Although embodiments disclosed in each section may benefit from the features disclosed in the other section, such features should be regarded as examples rather than requirements unless clearly indicated as such.

Section I: Deduplicating Full and Partial Block Matches

This section describes a new technique for performing deduplication. The technique includes traversing a deduplication database and assigning digest values in the database to buckets, where each bucket covers a respective range of digest values. To deduplicate a particular candidate block, the technique generates a digest from the candidate block and searches for the computed digest in a subset of the buckets, where the subset is selected based on the computed digest. If a target block providing an exact match or a suitably close partial match is found in the subset of buckets, the technique effects storage of the candidate block at least in part by providing a reference to the target block.

FIG. 1 shows an example environment 100 in which embodiments of the disclosed technique can be practiced. Here, multiple hosts 110 access a data storage system 116 over a network 114. The data storage system 116 includes a storage processor, or “SP,” 120 and storage 190, such as magnetic disk drives, electronic flash drives, and/or the like. The data storage system 116 may include multiple SPs (e.g., a second SP 120 a). For example, multiple SPs may be provided as circuit board assemblies or blades, which plug into a chassis that encloses and cools the SPs. The chassis has a backplane for interconnecting the SPs, and additional connections may be made among SPs using cables. In some examples, the SP 120 is part of a storage cluster, such as one which contains any number of storage appliances, where each appliance includes a pair of SPs connected to shared storage devices. In some arrangements, a host application runs directly on the SP (or SPs), such that separate host machines 110 need not be provided. No particular hardware configuration is required, however, as any number of SPs may be used, including a single SP, in any arrangement, and the SP 120 can be any type of computing device capable of running software and processing host I/O's.

The network 114 may be any type of network or combination of networks, such as a storage area network (SAN), a local area network (LAN), a wide area network (WAN), the Internet, and/or some other type of network or combination of networks, for example. In cases where hosts 110 are provided, such hosts 110 may connect to the SP 120 using various technologies, such as Fibre Channel, iSCSI (Internet small computer system interface), NFS (network file system), and CIFS (common Internet file system), for example. As is known, Fibre Channel and iSCSI are block-based protocols, whereas NFS and CIFS are file-based protocols. The SP 120 is configured to receive I/O requests 112 according to block-based and/or file-based protocols and to respond to such I/O requests 112 by reading or writing the storage 190.

The SP 120 includes one or more communication interfaces 122, a set of processing units 124, and memory 130. The communication interfaces 122 include, for example, SCSI target adapters and/or network interface adapters for converting electronic and/or optical signals received over the network 114 to electronic form for use by the SP 120. The set of processing units 124 includes one or more processing chips and/or assemblies, such as numerous multi-core CPUs (central processing units). The memory 130 includes both volatile memory, e.g., RAM (Random Access Memory), and non-volatile memory, such as one or more ROMs (Read-Only Memories), disk drives, solid state drives, and the like. The set of processing units 124 and the memory 130 together form control circuitry, which is constructed and arranged to carry out various methods and functions as described herein. Also, the memory 130 includes a variety of software constructs realized in the form of executable instructions. When the executable instructions are run by the set of processing units 124, the set of processing units 124 is made to carry out the operations of the software constructs. Although certain software constructs are specifically shown and described, it is understood that the memory 130 typically includes many other software components, which are not shown, such as an operating system, various applications, processes, and daemons.

As further shown in FIG. 1, the memory 130 “includes,” i.e., realizes by execution of software instructions, a data cache 140, a deduplication (“dedupe”) manager 150, and a dedupe database 160. The data cache 140 is configured to receive incoming writes of the I/O requests 112 and to store data 142 specified by those writes until the data 142 can be persisted in storage 190. The dedupe manager 150 is configured to orchestrate deduplication activities, such as maintaining the dedupe database 160 and directing deduplication of data blocks. The dedupe database 160 is configured to store entries that associate digests 162 of data blocks with corresponding storage locations 164. The storage locations 164 are those of data blocks from which the respective digests 162 are produced. In an example, each entry (not shown) associates one digest 162 with one location 164. As seen at the bottom-left of FIG. 1, a representative digest 162 x has a 64-bit value, which includes 32 MSBs (most significant bits) and 32 LSBs (least significant bits). Digests 162 may have any size and may be divided in any suitable manner, however.

In some examples, the dedupe database 160 is stored persistently in storage 190, with portions loaded into memory 130 as needed. In some examples, the in-memory version of the dedupe database 160 arranges the digests in pages 166, such as pages 166 a through 166 d. Any number of pages 166 may be provided.

In example operation, the dedupe manager 150 builds the dedupe database 160 by adding a new entry each time a data block is processed for deduplication but no match has yet been found. The dedupe manager 150 creates each entry by generating a digest 162 from a respective data block and storing the digest 162 in connection with a location 164 of that data block, which may be a cached location, a persisted location, or any other location, for example.

Over time, the dedupe database 160 may grow quite large. In accordance with improvements hereof, the dedupe manager 150 accesses the dedupe database 160 and proceeds to assign 182 digests 162 in the database 160 to buckets 170. The dedupe manager 150 assigns digests 162 to buckets 170 based on digest values. For example, the MSBs of digests 162 (e.g., the leftmost 32 bits; see digest 162 x) may form bucket identifiers (IDs) 172, which uniquely identify respective buckets 170. As there are 32 bits of MSBs in the example shown, up to 2³² unique buckets 170 may be addressed. Also, each bucket 170 can be associated with as many individual digests as the LSBs (rightmost bits) will allow. As there are 32 bits of LSBs (as shown), each bucket 170 can “contain” (have associated therewith) up to 2³² unique digests 162. With the pictured arrangement, each bucket 170 can be regarded as having a “range,” where each range includes all the digests 162 that have the same MSBs.

In an example, the dedupe manager 150 creates buckets 170 as needed based on the digests 162 it encounters while traversing the dedupe database 160. Thus, it is not necessary for the dedupe manager 150 to create 2³² buckets 170 in advance and, typically, the actual number of buckets 170 in use at any given time is much smaller than 2³².

In some examples, the dedupe manager 150 assigns 182 digests 162 to buckets 170 by accessing multiple pages 166 of the dedupe database 160 (i.e., the in-memory version) and processing multiple pages 166 together. Operating in this manner has the effect of amortizing data access over large amounts of data and leveraging locality of data and related metadata.

One should appreciate that assigning digests 162 to buckets 170 need not require copying or moving of any data. Rather, each bucket 170 may be realized as a list of digests 162 or associated entries, which are stored in the dedupe database 160.

As further shown in FIG. 1, the dedupe manager 150 may further arrange buckets 170 into subsets 180 of buckets 170 (e.g., subsets 180 a-180P). In an example, subsets 180 of buckets are formed based on similarities among bucket IDs 172. Similarity may be measured, for example, based on Hamming distance, i.e., numbers of bits (or other symbols) that are different. For example, a bucket ID 172 of “AB124F76” (in hexadecimal notation) has a Hamming difference of 1 from a bucket ID of “BB124F76,” as only a single bit is different. Likewise, the bucket ID 172 of “AB124F76” has a Hamming difference of 2 from “BB134F76,” as 2 bits are different. As bucket IDs 172 in the example shown are formed from 32 MSBs, there are exactly 32 bucket IDs 172 that differ by a Hamming distance of 1 from any given bucket ID. A much larger number of bucket IDs differ by a Hamming distance of 2.

In an example, the dedupe manager 150 creates each subset 180 of buckets 170 by combining a matching bucket 170 m, i.e., a bucket whose ID 172 exactly matches the MSBs of a digest 162, with each of the other buckets 170 whose bucket IDs 172 are a predetermined Hamming distance away from that of the matching bucket 170 m. In an example, the predetermined Hamming distance is 1, meaning that each subset 180 contains 33 buckets—the matching bucket 170 m and the 32 buckets that are one unit of Hamming distance away.

The use of buckets 170 provides an effective platform for performing deduplication, whether inline, near-inline, or in the background. The advantages are particularly pronounced when digests 162 include similarity hashes, i.e., hashes for which similarities among digests 162 correspond to similarities among data blocks from which the hashes are created. Example similarity hashes are described more fully in connection with FIG. 3.

FIGS. 2A and 2B show an example method 200 for deduplicating data. The method 200 may be carried out, for example, by the dedupe manager 150 and the other software constructs shown in FIG. 1. Although the acts of method 200 are shown in a particular order, the depicted order is an example only, and other examples may include performing acts in orders different from the one shown, which may include performing some acts simultaneously.

At 208 of FIG. 2A, a candidate block 142 c is obtained. For example, the dedupe manager 150 obtains the candidate block 142 c from the data cache 140 (e.g., in the inline dedupe case) or from storage 190 (in the background case).

At 212, the dedupe manager 150 generates a candidate digest 162 c from the candidate block 142 c, e.g., by generating a sim hash of the candidate block 142 c.

At 214, the dedupe manager 150 identifies a matching bucket 170 m based on the candidate digest 162 c, e.g., by forming a bucket ID 172 from the MSBs of the candidate digest 162 c and searching for a bucket with that bucket ID. If no bucket ID 172 exists for these MSBs, the dedupe manager 150 may create a new bucket whose bucket ID 172 matches the MSBs.

At 216, the dedupe manager 150 searches for an exact match to the candidate block 142 c in the matching bucket 170 m, e.g., by attempting to match the candidate digest 162 c to a target digest 162 t of a block assigned to the matching bucket 170 m. Depending on the uniqueness of the digests 162, the dedupe manager 150 may confirm the match, e.g., by comparing the data of the candidate block 142 c with that of the target block 142 t and verifying that they are the same. In some examples, the digests 162 may include cryptographic hashes of respective blocks (e.g., in addition to sim hashes). In such an example, the dedupe manager 150 may confirm the match by comparing cryptographic hashes.

At 218, if an exact match is found, operation proceeds to 220, whereupon the dedupe manager 150 deduplicates the candidate block 142 c by storing a reference to the target block 142 t. For example, the dedupe manager 150 maps a logical address of the candidate block 142 c to the data of the target block 142 t, which me be found at the location 164 of the target block 142 t, as stored in the dedupe database 160.

If no exact match is found at 218, operation instead proceeds to 250 (FIG. 2B), whereupon the dedupe manager 150 searches for a partial match to the candidate block 142 c in the matching bucket 170 m. The dedupe manager 150 may achieve this end, for example, by locating a target block 142 t whose digest 162 t differs from that of the candidate block 142 c by less than a predetermined Hamming distance, such as 2, for example.

At 252, if a partial match can be found in the matching bucket 170 m within the predetermined Hamming distance, operation proceeds to 254, whereupon the dedupe manager 150 deduplicates the candidate block 142 c by providing a reference to the target block 142 t, e.g., in a manner similar to that described in connection with act 220 above. The dedupe manager 150 also provides a reference to difference data 210, i.e., data that indicates a difference between the candidate block 142 c and the target block 142 t.

The difference data 210 may be provided in any suitable way. In one example, the dedupe manager 150 computes the difference data 210 as a bitwise XOR (exclusive-OR) of the candidate block 142 c with the target block 142 t. The result of the XOR function has a 1 at every bit location where the two blocks differ and a 0 at every bit location where the two blocks are the same. The XOR result may be compressed to a small size and stored. Later, when it becomes necessary to reconstruct the candidate block 142 c, the SP 120 can obtain the target block 142 t and the difference data 210, decompress them, and XOR them together, with the result of the XOR restoring the original candidate block 142 c.

Continuing from 252, if no partial match can be found within the predetermined Hamming distance, operation proceeds to 260, whereupon the dedupe manager 150 extends the scope of the search for a suitable target block 142 t to the other buckets 170 in the same subset 180, i.e., the subset of buckets that contains the matching bucket 170 m.

At 262, if a partial match can be found in any of the buckets 170 of the subset within the predetermined Hamming distance, operation proceeds to 264, whereupon the dedupe manager 150 deduplicates the candidate block 142 c as in 254, by providing references to both the target block 142 t and the difference data 210.

If no suitable partial match can be found, e.g., within a Hamming distance of 1, operation proceeds to 270, whereupon the SP 120 may attempt other strategies to achieve data reduction on the candidate block 142 c. If no good options are available, the dedupe manager 150 may simply store the candidate block 142 c without using data reduction.

FIG. 3 shows an example arrangement 300 for generating a similarity hash (sim hash) 340. Many methods may be used for generating sim hashes, and the example shown is intended to be illustrative rather than limiting.

The illustrated approach begins by obtaining a candidate block 142 c and dividing the block into multiple features 310. Each feature 310 is a portion of the candidate block 142 c, and together the features 310 make up the entire candidate block 142 c. Features 310 may be arbitrarily small, with 4 or 8 Bytes being expected sizes. There is no need for different features 310 to have the same length, however.

As shown by arrow 312, the data of each feature 310 is salted with a location indicator, which corresponds, for example, to a relative position of the respective feature in the block 142 c. For instance, the first feature (topmost) may be salted by concatenating this feature with a “1,” the second feature may be salted by concatenating it with a “2,” and so forth. Salting each feature 310 with an indicator of its position ensures that the same feature is represented differently when it appears in different positions within the block 142 c.

As shown by arrow 320, a hash function is executed on each salted feature 310 individually. The hash function may be a fully cryptographic or semi-cryptographic hash function, for example.

As shown by arrow 330, each hash function produces a respective hash value, with one hash value produced for each feature 310. The bits of each hash value are shown horizontally, e.g., with the MSB of the hash value on the left and the LSB on the right.

The corresponding bits of the hash values are then summed (vertically) to produce a column sum 332 for each bit position of the feature-hashes. The column sums 332 are then binarized (334) to produce respective results. Binarizing each sum 332 includes, for example, setting the result to “1” if the column sum is greater than the number of features 310 in the block 142 c divided by 2 and setting the result to “0” otherwise. Stated another way, results are set to “1” if more than half the bits in the column are “1;” otherwise they are set to “0.” The results of binarization taken together and in order form a sim hash 340. The sim hash 340 thus includes a bit for each bit of the feature-hashes 330.

The sim hash 340 has the desired property of producing similar results for similar candidate blocks 142 c but of producing increasingly different results for increasingly different candidate blocks 142 c. The illustrated arrangement thus allows Hamming distances between sim hashes 340 to be used as a proxy for Hamming distances between the corresponding blocks. Owing to the manner in which sim hashes 340 are generated, they should generally not be relied upon for exact-block matching, as it is possible for two sim hashes 340 to be identical even though the underlying blocks are different.

Sim hashes 340 may form the entirety of digests 162 (one sim hash per digest), but this is not required. For example, digests 162 may include other components. These components may include full or semi-cryptographic hashes of respective blocks. They may also include sim hashes of particular sub-blocks. According to some variants, each digest 162 includes a sim hash of a particular sector of the respective block. The particular sector may be selected as the highest entropy sector in the block, such that blocks can be matched even if they are misaligned relative to usual block boundaries. In some examples, digests 162 include sector sim hashes but not full-block sim hashes, with the same methodology applied (e.g., buckets and subsets) as described above, but operating based on sector sim hashes rather than on full-block sim hashes.

FIG. 4 shows an example arrangement for mapping data when performing partially matching deduplication. The structures shown in FIG. 4 may reside in the memory 130 of the SP 120, for example (FIG. 1).

As shown, the data cache 140 stores data elements 142, such as blocks, which include a candidate block 142 c. For example, the blocks 142 may have been recently written to the data storage system by hosts 110. Each block 142 may have an associated logical address (LA), which the I/O request 112 that wrote the block has specified. Each logical address may correspond to a host address of the block, such as an offset into a file, a range of a LUN (Logical UNit), or the like.

To effect storage of the candidate block 142 c, SP 120 represents a logical address 412 of the block 142 c in a logical storage layer 410. The SP 120 then maps the logical address 412 to lower layers using mapping structures 422 (e.g., block pointers) in a mapping layer 420. The mapping layer 420 maps the logical address 412 to a virtual block structure 432 in a virtual block layer 430, and the virtual block structure 432 maps to a physical block layer 440. As the depicted arrangement supports partial block matching, the virtual block structure 432 provides two pointers, a first pointer to the target block 142 t and a second pointer to the difference data 210. As described previously, the difference data 210 may be provided as a compressed version of the candidate block 142 c XORed with the target block 142 t. Additional layers (not shown) further map the target block 142 t and difference data 210 to storage 190.

FIGS. 5A-5C show an example arrangement for using clustering to facilitate deduplication. As shown in FIG. 5A, a given subset 180 of buckets 170 provides a domain for performing clustering on digests 162. For example, the dedupe manager 150 performs clustering 510 on digests 162 (e.g., sim hashes 340) found in the buckets 170 of subset 180, by arranging the digests 162 based on relative Hamming distance 520. For example, a first digest 162 examined may provide a baseline against which relative Hamming distances 520 of other digests 162 may be measured. Buckets 170 may each include hundreds or more digests 162, and the digests 162 when arranged on a line based on relative Hamming distance 520 naturally tend to form clusters 530. Each cluster 530 has a centroid 540, which is typically the digest 162 closest to the center of that cluster 530. The centroid 540 is thus the digest 162 that has the smallest average Hamming distance to each of the other digests in the cluster.

FIG. 5B shows an example method 550 for performing the clustering 510 of FIG. 5A. The method 550 may be carried out, for example, by the dedupe manager 150 and/or other software constructs in the memory 130 (FIG. 1).

At 552, the dedupe manager 150 traverses the subset 180 of buckets 170 and obtains multiple digests 162 from the buckets. In an example, this operation involves the dedupe manager 150 accessing the dedupe database 160, e.g., by loading multiple pages 166, selecting a digest 162 from the dedupe database 160 as a candidate, and then forming a matching bucket 170 m and corresponding subset 180 based on the selected candidate. In some examples, candidate selection is based at least in part on popularity. For example, entries in the dedupe database 160 may store reference counts (in addition to digests 162 and locations 164). The reference counts indicate how many logical addresses have been mapped to the block represented in that digest entry. Entries with high reference counts are likely to yield larger clusters 530 than entries with smaller reference counts and are thus preferred when selecting candidates. In some examples, the dedupe manager 150 skips the creation of buckets 170 and creates clusters 530 directly from the dedupe database 160. In this manner, contents of clusters 530 need not be limited to particular buckets 170 or subsets 180.

At 554, the dedupe manager 150 iterates over each digest 162 (sim hash) in the subset 180. At 556, for example, the dedupe manager 150 checks whether it can assign the current sim hash to any cluster 530, e.g., by determining whether the sim hash 340 is within a threshold Hamming distance of the centroid 540 of any cluster 530. If the dedupe manager 150 succeeds in finding a closely-matching cluster in this manner, then at 560 the dedupe manager 150 adds the current sim hash 340 to the closely-matching cluster 530. The dedupe manager 150 may also recompute the centroid 540 of this cluster 530 to account for the new member.

If at 554 no close-enough cluster 530 can be found, operation proceeds to 558, whereupon the current sim hash 340 may be used as the centroid 540 of a new cluster 530. Either way, operation proceeds to 562, where the acts 554-560 are repeated for a next sim hash 540.

One should appreciate that the method 550 is preferably run in the background, out of band with I/O requests 112, as available resources allow.

FIG. 5C shows an example method 570 for performing deduplication using the clusters 530. The method 570 may also be carried out by the dedupe manager 150 and/or other software constructs in the memory 130.

At 572, the dedupe manager 150 selects a cluster 530 for processing, preferably selecting the cluster having the greatest number of members.

At 574, the dedupe manager 150 performs a partial dedupe on the blocks represented by the selected cluster 530. In an example, partial deduplication is performed by using the block represented by the centroid 540 of the selected cluster 530 as a target block and using the blocks represented by all the other sim hashes 340 in the cluster 530 as candidate blocks. Partial block deduplication can then proceeds as described above, e.g., by effectuating storage of each candidate block by storing one reference to the target block (centroid) and another reference to difference data 210 (based on the difference between each candidate block and the centroid).

Once the current cluster 530 has been processed, operation returns to 572, whereupon the dedupe manager 150 obtains the next largest cluster and repeats step 574 for the new cluster. Operation proceeds in this manner indefinitely.

Method 570 preferably also runs in the background, as resources allow. In some examples, the methods 550 and 570 are performed more or less continuously, as lazy background processes, taking advantage of system resources when they are available to improve storage efficiency. Although cluster-based deduplication has been described with reference to computed centroids 540 of clusters 530, one should appreciate that the centroids 540 need not be precise and may be approximations rather than exact values. Also, although a particular clustering method has been described, embodiments are not limited to any particular type of clustering. Suitable example clustering methods may include K-means clustering, mean-shift clustering, Density-Based Spatial Clustering of Applications with Noise (DBSCAN), Expectation-Maximization (EM) Clustering using Gaussian Mixture Models (GMM), and agglomerative hierarchical clustering. Ad hoc clustering methods may be used, and different clustering methods may be combined in any suitable way.

FIG. 6 shows an example method 600 that may be carried out in connection with the environment 100. The method 600 is typically performed, for example, by the software constructs described in connection with FIG. 1, which reside in the memory 130 of the storage processor 120 and are run by the set of processors 124. The various acts of method 600 may be ordered in any suitable way. Accordingly, embodiments may be constructed in which acts are performed in orders different from that illustrated, which may include performing some acts simultaneously.

At 610, multiple digests 162 in a deduplication database 160 are assigned 182 to multiple buckets 170. Each bucket 170 is dedicated to a respective range 172 of digest values.

At 620, upon obtaining a candidate block 142 c of data to be deduplicated, a candidate digest 162 c is generated of the candidate block 142 c and a subset 180 of the buckets 170 is searched for the candidate digest 162 c. The subset 180 of the buckets 170 is selected for searching based on the candidate digest 162 c, e.g., by using MSBs of the candidate digest 162 c as a bucket ID 172 of a matching bucket 170 m and including in the subset 180 the matching bucket 170 m as well as all the other buckets whose bucket IDs are a predetermined Hamming distance away from that of the matching bucket 170 m.

At 630, in response to the searching identifying a target digest 162 t that represents a target block 142 t that at least partially matches the candidate block 142 c, storage of the candidate block 142 c is effectuated at least in part by providing a reference to the target block 142 t. In cases of partial matches, storage of the candidate block 142 c may further be effectuated by providing a reference to difference data 210.

A technique has been described for performing deduplication. The technique traverses a deduplication database 160 and assigns digest values 162 in the database 160 to buckets 170, where each bucket 170 covers a respective range 172 of digest values. To deduplicate a particular candidate block 142 c, the technique generates a digest 162 c from the candidate block and searches for the computed digest 162 c in a subset 180 of the buckets 170, where the subset 180 is selected based on the computed digest 162 c. If a target block 142 t providing an exact match or a suitably close partial match is found in the subset 180 of buckets 170, the technique effects storage of the candidate block 142 c at least in part by providing a reference to the target block 142 t.

Section II: Opportunistic Partial Deduplication

This section describes an improved technique for managing deduplication. The technique performs partial-block matching opportunistically by leveraging information acquired during times when a storage system has available resources. The information identifies anchor blocks that are likely targets for partial-block matches, based on discovering that the anchor blocks belong to populations of blocks that have high similarity. When processing write requests, inline activities access anchor blocks that closely match newly arriving candidate blocks and perform partial-block deduplication against those anchor blocks. Partial-block deduplication can thus be performed inline without unduly taxing system resources. The technique described in this section may be performed, for example, in the environment 100 described in Section I. The technique of this section is not limited to that environment, however, nor is it limited to its specific features.

FIG. 7 shows the example environment of FIG. 1 and provides additional details that pertain to opportunistic partial deduplication. Features indicated with like reference numerals are similar to those described in Section I. As shown and previously described, the storage processor (SP) 120 has a memory 130, which includes data cache 140, dedupe manager 150, and dedupe database 160. In accordance with particular improvements hereof, the memory 130 also includes an anchor table 760. The anchor table 760 may be located in main memory, cache, or in some other readily accessible memory medium. The anchor table 760 may be constructed like the dedupe database 150, e.g., by associating digests 162 of blocks with respective locations 164 in storage, but the anchor table 760 may be focused on specific blocks (anchor blocks) that are expected to provide effective targets for partial-block deduplication.

In an example, the dedupe manager 150 selects the anchor blocks (those listed in the anchor table 760) based on clustering, such as the clustering described in connection with FIGS. 5A-5C. For instance, the dedupe manager 150 is configured to form clusters 530 and to select the anchor blocks from the largest clusters, i.e., those containing the greatest numbers of blocks. For example, the dedupe manager 150 ranks clusters 530 by size and selects centroids 540 (or other representative blocks) for inclusion in the anchor table 760 from a subset of the clusters, i.e., the largest clusters. As shown, for example, the cluster manager 150 has included centroids 540 b and 540 c in the anchor table 760, based on those centroids belonging to large clusters 530 b and 530 c, but has excluded centroid 540 a, based on centroid 540 a belonging to a smaller cluster 530 a. The dedupe manager 150 preferentially selects larger clusters over smaller clusters based on the expectation that large populations of similar blocks are more likely than smaller populations to yield targets for partial-block matches in the future.

As described previously, the centroid 540 of each cluster 530 corresponds to the block that minimizes Hamming distances to other blocks in the same cluster, with Hamming distances measured based on sim hashes 340. Thus, each centroid 540 is approximately the middle block in each cluster, with the “middle” judged based on relative Hamming distance. Centroids 540 are not required to be exact, however.

In an example, the dedupe manager 150 identifies anchor blocks based on clustering performed in the background or at other times when excess system resources are available. Thus, the lazy background process, as described in Section I for performing background deduplication based on clustering, may also be leveraged for creating the anchor table 760, which SP 120 may use for inline and near-inline deduplication.

In an example, inline deduplication proceeds as follows. Hosts 110 issue I/O requests 112 directed to the data storage system 116. The I/O requests 112 may include write requests 112 w, which specify data to be written to designated logical addresses (LAs), such as particular offsets into a LUN (Logical UNit), particular ranges of a file, or the like. The data storage system 116 receives the write requests 112 w and initiates processing. For example, the data cache 140 arranges the data specified in write requests 112 w into blocks 142. The dedupe manager 150 acquires the blocks 142 and attempts to perform inline deduplication on the blocks 142. For example, the dedupe manager 150 attempts to match the blocks 142 to already-stored blocks and, if matches are found, points the logical addresses of those blocks 142 to locations of the already-stored blocks, avoiding redundant storage. In the case of partial-block deduplication, the dedupe manager 150 also points the logical addresses of the blocks 142 to difference data 210, which is computed based on differences between the blocks 142 and the partially-matched target blocks (FIGS. 2A and 2B).

In attempting to match a candidate block 142 c to an already-stored block in the system, the dedupe manager 150 may generate a candidate digest 162 c from the candidate block 142 c, where the candidate digest 162 c includes a sim hash 340 (FIG. 3) of the candidate block 142 c. The dedupe manager 150 then attempts to match the candidate digest 162 c to a target digest 162 t. Such an attempt may include checking for a match (or partial match) in the anchor table 760. For example, the dedupe manager 150 attempts to locate a digest 162 in the anchor table 760 whose sim hash 340 falls within a predetermined Hamming distance of the sim hash of the candidate block 142 c. The predetermined Hamming distance may be 1, 2, or any other suitable value.

If the dedupe manager 150 succeeds in finding a digest 162 in the anchor table 760 whose sim hash matches that of the candidate block 142 c to within the predetermined Hamming distance, the dedupe manager 150 selects the block corresponding to the matching digest as a target block 142 t and deduplicates the candidate block 142 c against that target block 142 t. For example, the dedupe manager 150 arranges system metadata to point the logical address of the candidate block 142 c to data of the identified target block 142 t. In the case of a partial match, the dedupe manager 150 also creates difference data 210, e.g., by XORing the candidate block 142 c with the target block 142 t, compressing the result, and further associating the logical address of the candidate block 142 c with the difference data 210.

In some examples, the dedupe manager 150 attempts a variety of techniques for matching the candidate block 142 c to a target block. For example, the dedupe manager 150 may check the in-memory version of the dedupe database 160 for a match (or partial match). It may also check within a matching bucket 170 m or a matching subset of buckets 180 (FIG. 1). Thus, the anchor table 760 may not be the only option available for inline matching and it may not be the first option attempted.

FIGS. 8 and 9 show example methods 800 and 900. The methods 800 and 900 may be performed, for example, by the software constructs shown in FIGS. 1 and 7, which reside in the memory 130 of SP 120 and are executed by the set of processing units 124. The orders of the acts shown in methods 800 and 900 should be understood to be examples and are not intended to be limiting. Thus, embodiments may be constructed that include performing the methods 800 and 900 in orders different from those shown, which may include performing some acts simultaneously.

In FIG. 8, the method 800 is shown for performing inline deduplication based on partial-block matches. At 810, the SP 120 receives an I/O request 112 w that specifies a write of data to a specified logical address. The SP 120 arranges the data as a candidate block 142 c.

At 820, the SP 120 generates a candidate digest 162 c from the candidate block 142 c. The candidate digest 162 c includes a sim hash 340 of the candidate block 142 c. In some examples, the candidate digest 162 c is formed entirely from the sim hash 340 of the candidate block 142 c.

At 830, the SP 120 searches the anchor table 760 for a target digest D_(540x) whose sim hash 340 is similar to that of the candidate block 142 c. For example, the SP 120 locates a target digest D_(540x) whose sim hash is within a predetermined Hamming distance of the sim hash of the candidate block 142 c.

At 840, if a partial match is found, meaning that a target digest D_(540x) is found whose sim hash is within the predetermined Hamming distance, operation proceeds to 850, whereupon the SP 120 deduplicates the candidate block 142 c by associating its logical address with a reference to the location 164 t of the target block 142 t and a reference to the difference data 210, which may be based on the difference (e.g., XOR) between the candidate block 142 c and the target block 142 t. Although not shown, it is also possible that an exact match will be found in the anchor table 760, in which case there will be no need to create or point to difference data 210 during act 850.

If no match (partial or exact) is found at 840, operation instead proceeds to 860, whereupon other data reduction techniques may be attempted, which may include accessing the dedupe database 160, accessing buckets 170, or bailing out of inline deduplication and compressing the data instead. If no suitable techniques are available, the SP 120 may store the candidate block 142 c without data reduction.

In FIG. 9, the method 900 is shown for opportunistically performing partial-block deduplication. At 910, multiple target blocks, such as anchor blocks referenced in anchor table 760, are identified that belong to respective populations of data blocks, such as clusters 530, where each population or cluster 530 includes data blocks that partially match one another. For example, the data blocks in each cluster 530 may have sim hashes 340 that differ from one another by less than a predetermined Hamming distance. The clusters 530 may be formed in any suitable way, which may include forming buckets 170 and subsets of buckets 180, or using other techniques.

At 920, upon obtaining a candidate block 142 c, one of the target blocks, e.g., one of those listed in the anchor table 760, is selected based on that target block 142 t partially matching the candidate block 142 c, e.g., based on a sim hash 340 of the target block 142 t falling within a predetermined Hamming distance of a sim hash 340 of the candidate block 142 c.

At 930, storage of the candidate block 142 c is effectuated at least in part by providing a reference to the selected target block 142 t, e.g., by associating a logical address of the candidate block 142 c with a location where the data of the target block 142 t is stored. At this time, the SP 120 may further associate the logical address of the candidate block 142 c with a location of difference data 210, which provides a difference (e.g., XOR) between the candidate block 142 c and the target block 142 t.

An improved technique has been described for managing deduplication. The technique performs partial-block matching opportunistically by leveraging information, such as that found in anchor table 760, acquired during times when a storage system 116 has available resources. The information identifies anchor blocks that are likely targets for partial-block matches, based on discovering that the anchor blocks belong to populations 530 of blocks that have high similarity. When processing write requests 112 w, inline activities access anchor blocks that closely match newly arriving candidate blocks 142 c and perform partial-block deduplication against those anchor blocks. Partial-block deduplication is thus performed inline without unduly taxing system resources.

Having described certain embodiments, numerous alternative embodiments or variations can be made. For instance, the partial-block deduplication as described herein is not limited to inline deduplication, as the same information found in the anchor table 760 may also be leveraged by near-inline deduplication and even background deduplication. Further, although information about anchor blocks is described as being stored in anchor table 760, similar information may alternatively be stored elsewhere, such as in buckets 170 or in other locations.

Further, although features have been shown and described with reference to particular embodiments hereof, such features may be included and hereby are included in any of the disclosed embodiments and their variants. Thus, it is understood that features disclosed in connection with any embodiment are included in any other embodiment.

Further still, the improvement or portions thereof may be embodied as a computer program product including one or more non-transient, computer-readable storage media, such as a magnetic disk, magnetic tape, compact disk, DVD, optical disk, flash drive, solid state drive, SD (Secure Digital) chip or device, Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA), and/or the like (shown by way of example as medium 650 in FIGS. 6 and 9). Any number of computer-readable media may be used. The media may be encoded with instructions which, when executed on one or more computers or other processors, perform the process or processes described herein. Such media may be considered articles of manufacture or machines, and may be transportable from one machine to another.

As used throughout this document, the words “comprising,” “including,” “containing,” and “having” are intended to set forth certain items, steps, elements, or aspects of something in an open-ended fashion. Also, as used herein and unless a specific statement is made to the contrary, the word “set” means one or more of something. This is the case regardless of whether the phrase “set of” is followed by a singular or plural object and regardless of whether it is conjugated with a singular or plural verb. Further, although ordinal expressions, such as “first,” “second,” “third,” and so on, may be used as adjectives herein, such ordinal expressions are used for identification purposes and, unless specifically indicated, are not intended to imply any ordering or sequence. Thus, for example, a “second” event may take place before or after a “first event,” or even if no first event ever occurs. In addition, an identification herein of a particular element, feature, or act as being a “first” such element, feature, or act should not be construed as requiring that there must also be a “second” or other such element, feature or act. Rather, the “first” item may be the only one. Also, the terms “based on” and “based upon” should be interpreted as meaning “based at least in part on” or “based at least in part upon,” as bases need not be exclusive unless explicitly stated. Although certain embodiments are disclosed herein, it is understood that these are provided by way of example only and should not be construed as limiting.

Those skilled in the art will therefore understand that various changes in form and detail may be made to the embodiments disclosed herein without departing from the scope of the following claims. 

What is claimed is:
 1. A method of performing data deduplication, the method comprising: forming populations of data blocks by (i) performing clustering of data blocks based on similarity among data blocks, the clustering producing a plurality of clusters, and (ii) selecting, based on cluster size, the populations of data blocks as a subset of the plurality of clusters; identifying multiple target blocks that belong to respective populations of data blocks, each population including data blocks that partially match one another; upon obtaining a candidate block, selecting one of the target blocks based on that target block partially matching the candidate block; and effectuating storage of the candidate block at least in part by providing a reference to the selected target block.
 2. The method of claim 1, further comprising: storing digests of the target blocks in memory; and performing inline deduplication based on creating a digest of a candidate block and finding in memory a digest of a target block that partially matches the digest of the candidate block.
 3. The method of claim 2, wherein storing the digests of the target blocks in memory includes providing the digests in an anchor table in memory, the anchor table associating the digests of target blocks with respective storage locations of the target blocks.
 4. The method of claim 2, wherein the digests of the target blocks and the digest of the candidate block include similarity hashes (sim hashes), the sim hashes of different blocks differing from one another in relation to differences among the different blocks.
 5. The method of claim 4, wherein performing the inline deduplication includes determining that the digest of the candidate block and a digest of a target block differ by no more than a specified Hamming distance.
 6. The method of claim 1, wherein performing the clustering of data blocks based on similarity includes: generating similarity hashes (sim hashes) of the data blocks; and comparing sim hashes generated from the data blocks, the sim hashes of the data blocks differing from one another relation to differences among the data blocks from which the sim hashes are generated.
 7. The method of claim 6, wherein performing the clustering of data blocks based on similarity further includes grouping together data blocks whose sim hashes differ from one another by less than a specified Hamming distance.
 8. The method of claim 6, wherein identifying the target blocks that belong to the respective populations includes selecting a representative block from each of the subset of clusters as the respective target block.
 9. The method of claim 8, wherein selecting each representative block includes choosing a block from each of the subset of clusters whose sim hash minimizes Hamming distances to sim hashes of other blocks in the respective subset of clusters.
 10. The method of claim 1, wherein effectuating storage of the candidate block further includes storing difference data between the candidate block and the selected target block.
 11. A computerized apparatus, comprising control circuitry that includes a set of processing units coupled to memory, the control circuitry constructed and arranged to: form populations of data blocks by (i) performing clustering of data blocks based on similarity among data blocks, the clustering producing a plurality of clusters, and (ii) selecting, based on duster size, the populations of data blocks as a subset of the plurality of clusters; identify multiple target blocks that belong to respective populations of data blocks, each population including data blocks that partially match one another; upon obtaining a candidate block, select one of the target blocks based on that target block partially matching the candidate block; and effectuate storage of the candidate block at least in part by providing a reference to the selected target block.
 12. A computer program product including a set of non-transitory, computer-readable media having instructions which, when executed by control circuitry of a computerized apparatus, cause the computerized apparatus to perform a method of performing data deduplication, the method comprising: forming populations of data blocks by (i) performing clustering of data blocks based on similarity among data blocks, the clustering producing a plurality of clusters, and (ii) selecting, based on cluster size, the populations of data blocks as a subset of the plurality of clusters; identifying multiple target blocks that belong to respective populations of data blocks, each population including data blocks that partially match one another; upon obtaining a candidate block, selecting one of the target blocks based on that target block partially matching the candidate block; and effectuating storage of the candidate block at least in part by providing a reference to the selected target block.
 13. The computer program product of claim 12, wherein the method further comprises: storing digests of the target blocks in memory; and performing inline deduplication based on creating a digest of a candidate block and finding in memory a digest of a target block that partially matches the digest of the candidate block.
 14. The computer program product of claim 13, wherein storing the digests of the target blocks in memory includes providing the digests in an anchor table in memory, the anchor table associating the digests of target blocks with respective storage locations of the target blocks.
 15. The computer program product of claim 13, wherein the digests of the target blocks and the digest of the candidate block include similarity hashes (sim hashes), the sim hashes of different blocks differing from one another in relation to differences among the different blocks.
 16. The computer program product of claim 15, wherein performing the inline deduplication includes determining that the digest of the candidate block and a digest of a target block differ by no more than a specified Hamming distance.
 17. The computer program product of claim 12, wherein performing the clustering of data blocks based on similarity includes: generating similarity hashes (sim hashes) of the data blocks; and comparing sim hashes generated from the data blocks, the sim hashes of the data blocks differing from one another relation to differences among the data blocks from which the sim hashes are generated. 